repositories:
- name: jetstack
  url: https://charts.jetstack.io

releases:
- name: certmanager-crds
  namespace: gitlab-managed-apps
  chart: ./crds-chart
  version: v1.1.0
  installed: true
  hooks:
  - events: [prepare]
    showlogs: true
    command: wget
    args:
      - -O
      - ./crds-chart/templates/00-crds.yaml
      - https://github.com/jetstack/cert-manager/releases/download/v1.7.1/cert-manager.crds.yaml

- name: certmanager
  namespace: gitlab-managed-apps
  chart: jetstack/cert-manager
  version: v1.7.1
  installed: true
  needs:
    - gitlab-managed-apps/certmanager-crds
  values:
    - values.yaml
  hooks:
  - events: ["presync"]
    showlogs: true
    command: "kubectl"
    args: ["label", "--overwrite", "namespace", "gitlab-managed-apps", "cert-manager.io/disable-validation=true"]
  # Wait for some apiservices to be ready, see https://github.com/helm/helm/issues/6361
  - events: ["postsync"]
    showlogs: true
    command: "sleep"
    args: ["120"]

- name: certmanager-issuer
  namespace: gitlab-managed-apps
  chart: ./issuer-chart
  version: v1.0.0
  installed: true
  disableValidation: true
  needs:
    - gitlab-managed-apps/certmanager
  values:
    - letsEncryptClusterIssuer:
        #
        # IMPORTANT: This value MUST be set to a valid email.
        #
        email: example@example.com
